<?php
session_start();
ini_set('display_errors',1);
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/database.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/functions.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/class.admin.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/class.modules.php');
$admin=new admin();
$admin->canView($_SERVER['PHP_SELF']);

$module=new module();
$modules=$_POST['module_active'];

foreach($modules as $key=>$val) {
	$criteria=array('$set'=>array('active'=>intval($val)));
	
	$module->saveModule($key,$criteria); // $keyid	
}


?>